package com.bytech.gateway.controller;

import com.bytech.common.biz.entity.base.BaseResult;
import com.bytech.gateway.service.DynamicRouteService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author Zhao
 * @Create 2021/8/15 18:50
 */
@RestController
@RequestMapping("/gateway")
public class GatewayController {

    @Resource
    private DynamicRouteService dynamicRouteService;

    @GetMapping("/route/manualUpdate")
    public BaseResult<String> updateGatewayRoute() {
        dynamicRouteService.notifyRouteChanged();
        return BaseResult.<String>success().build();
    }
}
